﻿using LDM.Framework.Application;
using Microsoft.Extensions.DependencyInjection;


namespace LDM.Framework;

public static class SwaggerDocServiceCollectionExtensions
{
    /// <summary>
    /// 添加 Swagger 文档的支持
    /// </summary>
    /// <param name="services"></param>
    /// <returns></returns>
    public static IServiceCollection AddSwaggerDoc(this IServiceCollection services)
    {
        if (App.AppSettings.EnableSwagger)
        {
            services.AddSwaggerGen(options => SwaggerManager.ConfigureSwaggerGen(options));
        }
        return services;
    }
}
